package com.ihr360.commons.entity.metadata;

import com.ihr360.commons.model.ICodedEntity;
import com.ihr360.commons.model.IEngNamedEntity;
import com.ihr360.commons.model.IEntity;
import com.ihr360.commons.model.INamedEntity;
import com.ihr360.commons.model.ITimeEntity;
import com.ihr360.commons.model.type.RoundType;

import java.io.Serializable;
import java.util.Set;

/**
 * 属性元信息
 */
public interface IPropertyMeta<ID extends Serializable, E extends IEntityMeta<ID, ? extends IPropertyMeta<ID, E>>> extends ITimeEntity, IEntity<ID>, ICodedEntity, INamedEntity, IEngNamedEntity {
    E getEntityMeta();

    void setEntityMeta(E entityMeta);

    boolean isSimpleType();

    String getTypeName();

    Set<String> getBusinesses();

    void setBusinesses(Set<String> businesses);

    Class<?> getType();

    void setType(Class<?> type);

    String getCode();

    void setCode(String code);

    String getName();

    void setName(String name);

    String getEngName();

    void setEngName(String engName);

    boolean isNullable();

    void setNullable(boolean nullable);

    boolean isUnique();

    void setUnique(boolean unique);

    int getMinLength();

    void setMinLength(int minLength);

    int getMaxLength();

    void setMaxLength(int maxLength);

    long getMin();

    void setMin(long min);

    long getMax();

    void setMax(long max);

    int getPrecision();

    void setPrecision(int precision);

    RoundType getRoundType();

    void setRoundType(RoundType roundType);

    boolean isEditable();

    void setEditable(boolean editable);

    boolean isUpdatable();

    void setUpdatable(boolean updatable);

    boolean isVisible();

    void setVisible(boolean visible);

    String getPropName();

    void setPropName(String propName);
}